package codeTest.baidu;

import java.util.Scanner;

/**
 * AK
 * Author: shen qi han
 * Date: 2022/3/22 下午7:44
 */
public class Main2 {


    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        String input = cin.next();

        // 贪心 left +  common + right
        // 0 xxxx 0
        // 1 xxxx 1
        int n = input.length();
        int a = 0, b = 0, c = 0, d = 0;
        int left0 = 0, right0 = n - 1;
        int left1 = 0, right1 = n - 1;
        for(int i = 0; i < n; i++){
            if(input.charAt(i) == '0'){
                left0 = i;
                break;
            }
        }
        for(int i = n - 1; i >= 0; i--){
            if(input.charAt(i) == '0'){
                right0 = i;
                break;
            }
        }
        for(int i = 0; i < n; i++){
            if(input.charAt(i) == '1'){
                left1 = i;
                break;
            }
        }
        for(int i = n - 1; i >= 0; i--){
            if(input.charAt(i) == '1'){
                right1 = i;
                break;
            }
        }

        int res0 = right0 - left0;
        int res1 = right1 - left1;

        if(res1 >= res0){
            a = left1;
            b = right1 - 1;
            c = left1 + 1;
            d = right1;
        }else{
            a = left0;
            b = right0 - 1;
            c = left0 + 1;
            d = right0;
        }
        a++;
        b++;
        c++;
        d++;

        System.out.println(a + " " + b + " " + c  + " " + d);

    }


}
